<#macro head>
    <#assign head_append>
        <#nested/>
    </#assign>
</#macro>
<#macro body>
    <#assign body_append>
        <#nested/>
    </#assign>
</#macro>

<#macro layout_default>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Pcode System</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="/misc/adminlte-2.3.7/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/misc/adminlte-2.3.7/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/misc/adminlte-2.3.7/dist/css/skins/skin-blue.min.css">
    <link rel="stylesheet" href="/misc/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="/misc/app/css/base.css">
    <!--[if lt IE 9]>
    <script src="/misc/html5shiv.min.js"></script>
    <script src="/misc/respond.min.js"></script>
    <![endif]-->
${head_append!}
</head>
<body class="hold-transition fixed skin-blue sidebar-mini">
<div class="wrapper">

    <!-- Main Header -->
    <header class="main-header">
        <a href="/" class="logo">
            <span class="logo-mini"><b>PCS</b></span>
            <span class="logo-lg">Pcode System</span>
        </a>

        <!-- Header Navbar -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- User Account Menu -->
                    <li class="dropdown user user-menu">
                        <!-- Menu Toggle Button -->
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <!-- The user image in the navbar-->
                            <img src="/misc/app/img/head.png" class="user-image"/>
                            <!-- hidden-xs hides the username on small devices so only the image appears. -->
                            <span class="hidden-xs">${user_session.account}</span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- The user image in the menu -->
                            <li class="user-header">
                                <img src="/misc/app/img/head.png" class="img-circle"/>
                                <p>${user_session.account} <#if user_session.admin><span class="label label-warning font-light">管理员</span></#if>
                                    <small>${user_session.companyName}</small>
                                </p>
                            </li>
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a href="/profile" class="btn btn-warning" style="width:80px;font-size:12px;"><i class="fa fa-user"></i> 个人资料</a>
                                </div>
                                <div class="pull-left" style="padding-left:5px;">
                                    <a href="/staff/editPwd" class="btn btn-warning" style="width:80px; font-size:12px;"><i class="fa fa-edit"></i> 修改密码</a>
                                </div>
                                <div class="pull-right">
                                    <a href="/logout" class="btn btn-danger" style="font-size:12px;"><i class="fa fa-sign-out"></i> 注销</a>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">

        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">

            <!-- Sidebar user panel (optional) -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="/misc/app/img/head.png" class="img-circle"/>
                </div>
                <div class="pull-left info">
                    <p>${user_session.account} <#if user_session.admin><span class="label label-warning font-light">管理员</span></#if></p>
                    <span class="text-muted">${user_session.companyName}</span>
                </div>
            </div>
            <!-- Sidebar Menu -->
            <ul class="sidebar-menu">
                <li class="header">快速导航</li>
                <#list Res_Tree as item>
                    <#if item.navnode>
                        <#if item.hasNavChild()>
                            <li class="treeview ${(Res_Node_Link[0]?exists && Res_Node_Link[0].id==item.id)?string("active","")}">
                                <a href="${item.path}"><#if item.icon?exists><i class="fa fa-${item.icon}"></i> </#if><span>${item.name}</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
                                <ul class="treeview-menu">
                                    <#list item.children as child>
                                        <#if child.navnode>
                                            <li ${(Res_Node_Link[1]?exists && Res_Node_Link[1].id==child.id)?string("class='active'","")}><a href="${child.path}"><#if child.icon?exists><i class="fa fa-${child.icon}"></i> </#if><span>${child.name}</span></a></li>
                                        </#if>
                                    </#list>
                                </ul>
                            </li>
                        <#else>
                            <li ${(Res_Node_Link[0]?exists && Res_Node_Link[0].id==item.id)?string("class='active'","")}><a href="${item.path}"><#if item.icon?exists><i class="fa fa-${item.icon}"></i> </#if><span>${item.name}</span></a></li>
                        </#if>
                    </#if>
                </#list>
            </ul>
            <!-- /.sidebar-menu -->
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <#if Current_Res_Node?exists>
            <section class="content-header">
                <h1><#if Current_Res_Node.icon?exists><i class="fa fa-${Current_Res_Node.icon}"></i> </#if>${Current_Res_Node.name}
                    <small>${Current_Res_Node.desc!}</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="/"><i class="fa fa-home"></i>首页</a></li>
                    <#list Res_Node_Link as item>
                        <#if item_has_next>
                            <li><a href="${item.path}">${item.name}</a></li>
                        <#else>
                            <li class="active">${item.name}</li>
                        </#if>
                    </#list>
                </ol>
            </section>
        </#if>
        <!-- Main content -->
        <section class="content">
            <#nested/>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <!-- Main Footer -->
    <footer class="main-footer hide">
        <!-- To the right -->
        <div class="pull-right hidden-xs">Pcode System</div>
        <!-- Default to the left -->
        <strong>Copyright &copy; 2016 <a href="https://www.91dida.cn" target="_blank">邸达科技有限公司</a>.</strong> All rights reserved.
    </footer>

</div>
<!-- ./wrapper -->

<script src="/misc/adminlte-2.3.7/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="/misc/adminlte-2.3.7/bootstrap/js/bootstrap.min.js"></script>
<script src="/misc/adminlte-2.3.7/dist/js/app.min.js"></script>
<script src="/misc/adminlte-2.3.7/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="/misc/bootbox.min.js"></script>
<script src="/misc/app/js/base.js"></script>
${body_append!}
</body>
</html>
</#macro>